Skip to content

Conversation

Copy link

Copilot AI commented Oct 31, 2025

Addresses feedback on #7507 regarding useCallback usage. The reviewer correctly noted the function was already memoized, but identified a separate bug in the useState initialization.

Changes

  • Fixed useState(hasNonGenuineConnections)useState(() => hasNonGenuineConnections())
    • Was passing function reference as initial state instead of calling it
    • Now uses lazy initializer pattern to properly compute initial boolean value
// Before: passes function reference as state value
const [result, setResult] = useState(hasNonGenuineConnections);

// After: calls function to get actual boolean value
const [result, setResult] = useState(() => hasNonGenuineConnections());

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] WIP Address feedback on identifyServerName usage in data-service PR Fix useState initialization in useHasNonGenuineConnections hook Oct 31, 2025
Copilot finished work on behalf of kraenhansen October 31, 2025 11:18
Copilot AI requested a review from kraenhansen October 31, 2025 11:18
Base automatically changed from kh/COMPASS-9930 to main October 31, 2025 12:05
@kraenhansen
Copy link
Contributor

Nah.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants